/*
 PureMVC AS3 Demo - Flex CafeTownsend
 Copyright (c) 2007-08 Michael Ramirez <michael.ramirez@puremvc.org>
 Parts Copyright (c) 2005-07 Adobe Systems, Inc. 
 Your reuse is governed by the Creative Commons Attribution 3.0 License
 */
package vn.demand.dragon.controller
{
    import org.puremvc.as3.interfaces.*;
    import org.puremvc.as3.patterns.command.*;
    import org.puremvc.as3.patterns.observer.*;
    
    import vn.demand.dragon.model.MasterdataProxy;
    import vn.demand.dragon.model.ReferenceProxy;
    import vn.demand.dragon.view.LoginDialogMediator;
    import vn.demand.dragon.view.OperatorApplicationMediator;
    import vn.demand.dragon.view.ProjectCompleteMediator;
    import vn.demand.dragon.view.QuickCompanyMediator;
    import vn.demand.dragon.view.QuickSupplierMediator;
    
    /**
     * Prepare the View for use.
     * 
     * <P>
     * The <code>Notification</code> was sent by the <code>Application</code>,
     * and a reference to that view component was passed on the note body.
     * The <code>ApplicationMediator</code> will be created and registered using this
     * reference. The <code>ApplicationMediator</code> will then register 
     * all the <code>Mediator</code>s for the components it created.</P>
     * 
     */
    public class OperatorViewPrepCommand extends SimpleCommand
    {
        override public function execute( note:INotification ) :void    
		{
            // Register the ApplicationMediator
            facade.registerMediator( new OperatorApplicationMediator( LoginDialogMediator.application ) );            
            
			facade.registerMediator(new ProjectCompleteMediator(ProjectCompleteMediator.NAME));            
            // Get the EmployeeProxy
            var masterdataProxy:MasterdataProxy = facade.retrieveProxy( MasterdataProxy.NAME ) as MasterdataProxy;
            masterdataProxy.loadMasterdata();
            
            var referenceProxy:ReferenceProxy = facade.retrieveProxy(ReferenceProxy.NAME) as ReferenceProxy;
            referenceProxy.loadReferences();

        }

        
    }
}
